<!--提现详情----->
<template>
  <scroller class="all bg1">
    <div v-if="data" class="wrapper">
      
      <div class="head">
        <text class="font48 text2">{{'- '+data.amount+" "+data.coinType}}</text>
      </div>
      <div class="line line1"></div>

      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现状态')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.payStatus}}</text>
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现类型')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{T('普通提现')}}</text>
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现时间')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.createTime}}</text>
      </div>

      <div class="height90"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现币种')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.chainName}}</text>     
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现数量')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.amount+" "+data.coinType}}</text>
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('手续费')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.fee+" "+data.coinType}}</text>
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('到账数量')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2">{{data.amountTemp+" "+data.coinType}}</text>
      </div>

      <div class="height90"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('提现地址')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2 all" @click="copyClick(data.toAddress)">{{data.toAddress}}</text>
        <LImage class="img-copy" :src="Config.img('hhr_activity_but_copy.png')" @click="copyClick(data.toAddress)"></LImage>
      </div>
      <div class="height50"></div>
      <div class="row">
        <text class="font28 text3 widht220">{{T('备注')}}</text>
        <div class="widht20"></div>
        <text class="font28 text2 all">{{data.remark}}</text>
      </div>
      <template v-if="data.txId">
        <div class="height50"></div>
        <div class="row">
          <text class="font28 text3 widht220">{{'Txid'}}</text>
          <div class="widht20"></div>
          <text class="font28 text2 all" @click="copyClick(data.txId)">{{data.txId}}</text>
          <LImage class="img-copy" :src="Config.img('hhr_activity_but_copy.png')" @click="copyClick(data.txId)"></LImage>
        </div>
      </template>

      <div class="height90"></div>
      <div class="row acenter">
      <text class="font22 text3">{{T('对此项交易有疑问，请')}}</text>
      <text class="font22 main-t1"  @click="lianxiClick">{{T('联系我们')}}</text>
      </div>
    </div>
  </scroller>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.wrapper{
  padding-bottom: 60px;
  padding-left: 40px;
  padding-right: 40px;
}
.head {
  justify-content: center;
  height: 150px;
}
.line {
  height: 1px;
  margin-right: -40px;
}
.img-copy {
  width: 25px;
  height: 25px;
  margin-left: 10px;
}
.widht220{
  width: 220px;
}
.height90 {
  height: 90px;
}
</style>

<script>
import jnavigator from "@/_js/navigator";
import jmodal from "@/_js/modal";
import jmath from "@/_js/math";
import jconfig from "@/_js/config";
import jhttps from "@/_js/https";
import jtime from "@/_js/time";


const clipboard = weex.requireModule("clipboard");
const weexFunction = weex.requireModule("WeexFunction");

import I18N from "@/_i18n/i18n";
var T = I18N.t;
weexFunction.setTitle(T('提现详情'));

export default {
  
  data() {
    return {
      T:T,
      Config:jconfig,

      orderId:"",
      data:undefined,
    };
  },

  created() {

    var param = weex.config;
    this.orderId = param.orderId;

    this.httpsInfo();
  },

  methods: {

    initData(data) {

      var status = {'UNPAID':T('提现中'),
                    'PAID':T('成功'),
                    'FAIL':T('失败'),
                    'AUDIT':T('待审核'),
                    'REJECT':T('审核失败')};
                    
      data.createTime = jtime.getTime(data.createTime, 'y/M/d H:m');
      data.payStatus = status[data.payStatus];

      //提现币种
      var coin = data.coinType;
      if (coin == 'VTN') {
        var equity = data.isVtnEquity ? T('含提现权益') : T('不含提现权益');
        coin = coin +'（'+ equity + '）';
      }
      data.coin = coin;

      return data;
    },

    /********************************* HTTP*/
    //https提现详情
    httpsInfo(){
      jmodal.showLoad();
      var param = {'orderId':this.orderId};
      jhttps.post("tradeV2/queryGetCashByOrderId",param,true,(data)=>{
        jmodal.hideLoad();
        if(data.status == 200){
          var data = data.data;
          this.data = this.initData(data);
        }else{
          jmodal.toast(data.msg);
        }
      });
    },

    /********************************* 点击*/
    //复制点击
    copyClick(value){
      jmodal.toast({message:T('复制成功'), duration:2});
      clipboard.setString(value);
    },

    //联系我们
    lianxiClick(){
      var nav = {'navColor':'#0c0c0c'};
      jnavigator.open("", "mine/Contract", undefined, nav);
    },
  },
};

</script>
